package com.wj.rpsm.admin.service.impl;

import com.github.pagehelper.Page;
import com.github.pagehelper.PageHelper;
import com.wj.rpsm.admin.mapper.BuildingMapper;
import com.wj.rpsm.admin.pojo.Building;
import com.wj.rpsm.admin.pojo.PageResult;
import com.wj.rpsm.admin.service.BuildingService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * @author WeiJin
 */
@Service
public class BuildingServiceImpl implements BuildingService {
    @Autowired
    BuildingMapper buildingMapper;
    @Override
    public PageResult<Building> pageOfBuilding(Integer current, Integer size, String key) {
        PageHelper.startPage(current,size);
        //返回ArrayList 子类Page
        Page<Building> buildings = buildingMapper.findAllBuilding(null);

        return PageResult.restPage(buildings);
    }
}
